#!/usr/bin/perl

use strict;
use warnings;
our @all;
while (<>) {
	s{^(.*)\s+(\d+)\s+(\S+)$}{$2 $3 $1}g;
	push(@all, $_);
}
sub numeric {
	my($x) = ($a =~ m{^(\d+)});
	my($y) = ($b =~ m{^(\d+)});
	return ($y || 0) <=> ($x || 0);
}
print sort numeric @all;
